﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DR.WebUI.Code;
using DR.WebUI.Models.Enums;

namespace DR.WebUI.Models.Developer
{
    //public class ReportModels
    //{
    //   // public int ProjectID { get; set; }
    //    public DateTime Date { get; set; }
    //    public int Hours { get; set; }
    //    public string Title { get; set; }
    //    public string Description { get; set; }
        
    //}

    public class NewReport
    {
        [Required]
        [StringLength(500)]
        public string Title { get; set; }

        [Required]
        [StringLength(5000)]
        public string Description { get; set; }

        [Required]
        [DisplayName("Project")]
        public int ProjectID { get; set; }

        [Required]
        [DisplayName("Reporting Period")]
        public int ReportingPeriodID { get; set; }

        [Required]
        [Range(1, 24)]
        public int Hours { get; set; }

        [Required]
        public DateTime Date { get; set; }
    }

    public class ReportModel
    {
        public string Title { get; set; }
        public string Project { get; set; }
        public decimal Hours { get; set; }
        public int ReportID { get; set; }
        public DateTime? DateReporting { get; set; }
        public DateTime DateCreate { get; set; }
        public DateTime? DateModified { get; set; }
        public ReportStatus State { get; set; }
        public bool CanDeleteByDeveloper { get; set; }
        public bool CanEditByDeveloper { get; set; }
    }

    public class DeveloperReportDetailModel
    {
        public int ReportID { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public string Hours { get; set; }
        public string State { get; set; }
        public string DateCreate { get; set; }
        public string DateReporting { get; set; }
        public string DateModified { get; set; }
        public string ReportingPeriod { get; set; }
        public string Project { get; set; }
        public bool CanDeleteByDeveloper { get; set; }
        public bool CanEditByDeveloper { get; set; }
    }

    public class ReportFilter
    {
        public int? ReportingPeriodID { get; set; }
        public int? ProjectID { get; set; }        
        private ISet<int> selectedReportStatuses = new HashSet<int>();
        public ISet<int> SelectedReportStatuses
        {
            get
            {
                return selectedReportStatuses;
            }
        }

        public ReportFilter()
        {
            selectedReportStatuses.Add((int)ReportStatus.Pending);
            selectedReportStatuses.Add((int)ReportStatus.Approved);
            selectedReportStatuses.Add((int)ReportStatus.Rejected);
        }

    }

    public class EditReport
    {
        public int ProjectID { get; set; }

        [Required]
        [StringLength(500)]
        public string Title { get; set; }

        [Required]
        public int ReportID { get; set; }

        [Required]
        public DateTime DateReporting { get; set; }

        public DateTime DateCreate { get; set; }
        public DateTime? DateModified { get; set; }

        [Required]
        [Range(1, 24)]
        public decimal Hours { get; set; }

        [Required]
        [StringLength(5000)]
        public string Description { get; set; }

        [Required]
        [DisplayName("Reporting Period")]
        public int ReportingPeriodID { get; set; }
    }

}